{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.106384Z",
     "start_time": "2018-08-25T11:26:58.940956Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.471099Z",
     "start_time": "2018-08-25T11:27:02.108400Z"
    }
   },
   "outputs": [],
   "source": [
    "dup = pd.read_csv('same_user_all.csv.gz')\n",
    "sub = pd.read_csv('stochastic_blending_v3-2_0.308rk7_0.431mw1_0.261t1_0.81050CV_0.3Adv.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.478552Z",
     "start_time": "2018-08-25T11:27:02.472839Z"
    }
   },
   "outputs": [],
   "source": [
    "dup_id_test = dup[dup.is_train==0].dup_id"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.488398Z",
     "start_time": "2018-08-25T11:27:02.480752Z"
    }
   },
   "outputs": [],
   "source": [
    "dup_test = dup[dup.dup_id.isin(dup_id_test)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.505580Z",
     "start_time": "2018-08-25T11:27:02.490398Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count    1600.000000\n",
       "mean        0.024063\n",
       "std         0.152780\n",
       "min         0.000000\n",
       "25%         0.000000\n",
       "50%         0.000000\n",
       "75%         0.000000\n",
       "max         1.000000\n",
       "Name: TARGET, dtype: float64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup_test.groupby('dup_id').TARGET.mean().describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.513530Z",
     "start_time": "2018-08-25T11:27:02.507422Z"
    }
   },
   "outputs": [],
   "source": [
    "dup_id_test_t0 = dup_test[dup_test.TARGET==0].dup_id\n",
    "dup_id_test_t1 = dup_test[dup_test.TARGET==1].dup_id"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:02.605404Z",
     "start_time": "2018-08-25T11:27:02.515348Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>CODE_GENDER</th>\n",
       "      <th>FLAG_OWN_CAR</th>\n",
       "      <th>FLAG_OWN_REALTY</th>\n",
       "      <th>CNT_CHILDREN</th>\n",
       "      <th>AMT_INCOME_TOTAL</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>...</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_WEEK</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_MON</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_QRT</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_YEAR</th>\n",
       "      <th>is_train</th>\n",
       "      <th>DAYS_BIRTH-m-DAYS_REGISTRATION</th>\n",
       "      <th>DAYS_REGISTRATION-m-DAYS_ID_PUBLISH</th>\n",
       "      <th>DAYS_ID_PUBLISH-m-DAYS_EMPLOYED</th>\n",
       "      <th>dup_cnt</th>\n",
       "      <th>dup_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>337039</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>222768.0</td>\n",
       "      <td>16785.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-21327.0</td>\n",
       "      <td>4065.0</td>\n",
       "      <td>-2883</td>\n",
       "      <td>2</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>128516</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>272520.0</td>\n",
       "      <td>15772.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-20723.0</td>\n",
       "      <td>2073.0</td>\n",
       "      <td>5075</td>\n",
       "      <td>2</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>147294</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>193500.0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>13662.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-20251.0</td>\n",
       "      <td>3382.0</td>\n",
       "      <td>1682</td>\n",
       "      <td>2</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>286683</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>72000.0</td>\n",
       "      <td>373500.0</td>\n",
       "      <td>22977.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19966.0</td>\n",
       "      <td>3042.0</td>\n",
       "      <td>-2160</td>\n",
       "      <td>2</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>303083</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>178213.5</td>\n",
       "      <td>16474.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19896.0</td>\n",
       "      <td>2904.0</td>\n",
       "      <td>-25</td>\n",
       "      <td>2</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>141114</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>328405.5</td>\n",
       "      <td>26077.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19857.0</td>\n",
       "      <td>1664.0</td>\n",
       "      <td>-1703</td>\n",
       "      <td>2</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>238419</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>790830.0</td>\n",
       "      <td>62482.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19833.0</td>\n",
       "      <td>2682.0</td>\n",
       "      <td>728</td>\n",
       "      <td>2</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>319192</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>1483650.0</td>\n",
       "      <td>61357.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19769.0</td>\n",
       "      <td>3319.0</td>\n",
       "      <td>1065</td>\n",
       "      <td>2</td>\n",
       "      <td>53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>165171</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>45000.0</td>\n",
       "      <td>4846.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19725.0</td>\n",
       "      <td>105.0</td>\n",
       "      <td>-864</td>\n",
       "      <td>2</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>190489</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>177750.0</td>\n",
       "      <td>177768.0</td>\n",
       "      <td>11488.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-19685.0</td>\n",
       "      <td>2849.0</td>\n",
       "      <td>-3169</td>\n",
       "      <td>2</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>345999</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>292500.0</td>\n",
       "      <td>745429.5</td>\n",
       "      <td>32962.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19587.0</td>\n",
       "      <td>2911.0</td>\n",
       "      <td>618</td>\n",
       "      <td>2</td>\n",
       "      <td>58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>197191</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>360000.0</td>\n",
       "      <td>810000.0</td>\n",
       "      <td>51763.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19519.0</td>\n",
       "      <td>3030.0</td>\n",
       "      <td>5811</td>\n",
       "      <td>2</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>407069</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>177768.0</td>\n",
       "      <td>13063.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19412.0</td>\n",
       "      <td>2927.0</td>\n",
       "      <td>-330</td>\n",
       "      <td>2</td>\n",
       "      <td>65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>129939</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>52128.0</td>\n",
       "      <td>5602.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19343.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>759</td>\n",
       "      <td>2</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>141</th>\n",
       "      <td>376354</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>254799.0</td>\n",
       "      <td>20259.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19334.0</td>\n",
       "      <td>2681.0</td>\n",
       "      <td>-2809</td>\n",
       "      <td>2</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>419788</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>32746.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-19310.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>2606</td>\n",
       "      <td>2</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>153</th>\n",
       "      <td>273429</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>189000.0</td>\n",
       "      <td>9778.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19279.0</td>\n",
       "      <td>2841.0</td>\n",
       "      <td>564</td>\n",
       "      <td>2</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>115705</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>296505.0</td>\n",
       "      <td>27324.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19142.0</td>\n",
       "      <td>267.0</td>\n",
       "      <td>-292</td>\n",
       "      <td>2</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>304483</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>479700.0</td>\n",
       "      <td>50503.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19115.0</td>\n",
       "      <td>2378.0</td>\n",
       "      <td>-2389</td>\n",
       "      <td>2</td>\n",
       "      <td>86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>417778</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>675000.0</td>\n",
       "      <td>28728.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19114.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1579</td>\n",
       "      <td>2</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>424262</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>350181.0</td>\n",
       "      <td>34762.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19106.0</td>\n",
       "      <td>2542.0</td>\n",
       "      <td>-481</td>\n",
       "      <td>2</td>\n",
       "      <td>89</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>199424</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>153000.0</td>\n",
       "      <td>296280.0</td>\n",
       "      <td>15255.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19034.0</td>\n",
       "      <td>2580.0</td>\n",
       "      <td>-1946</td>\n",
       "      <td>2</td>\n",
       "      <td>93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>259228</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>1062000.0</td>\n",
       "      <td>38277.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-19024.0</td>\n",
       "      <td>2545.0</td>\n",
       "      <td>-1240</td>\n",
       "      <td>2</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>267581</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>247500.0</td>\n",
       "      <td>1071000.0</td>\n",
       "      <td>34677.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-18982.0</td>\n",
       "      <td>2532.0</td>\n",
       "      <td>-2680</td>\n",
       "      <td>2</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>207</th>\n",
       "      <td>263479</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>382500.0</td>\n",
       "      <td>19660.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18916.0</td>\n",
       "      <td>2454.0</td>\n",
       "      <td>-1527</td>\n",
       "      <td>2</td>\n",
       "      <td>103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>213</th>\n",
       "      <td>308919</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>457312.5</td>\n",
       "      <td>29353.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18866.0</td>\n",
       "      <td>2392.0</td>\n",
       "      <td>4510</td>\n",
       "      <td>2</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>223</th>\n",
       "      <td>320412</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>756504.0</td>\n",
       "      <td>24534.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18812.0</td>\n",
       "      <td>1285.0</td>\n",
       "      <td>4368</td>\n",
       "      <td>2</td>\n",
       "      <td>111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>229</th>\n",
       "      <td>230122</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>320922.0</td>\n",
       "      <td>38214.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18788.0</td>\n",
       "      <td>2345.0</td>\n",
       "      <td>-129</td>\n",
       "      <td>2</td>\n",
       "      <td>114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>245</th>\n",
       "      <td>292267</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>324000.0</td>\n",
       "      <td>20704.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18694.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-727</td>\n",
       "      <td>2</td>\n",
       "      <td>122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>261</th>\n",
       "      <td>312997</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>797818.5</td>\n",
       "      <td>40864.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-18636.0</td>\n",
       "      <td>2182.0</td>\n",
       "      <td>-22</td>\n",
       "      <td>2</td>\n",
       "      <td>130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8563</th>\n",
       "      <td>351091</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>398160.0</td>\n",
       "      <td>25573.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-2588.0</td>\n",
       "      <td>-6292.0</td>\n",
       "      <td>678</td>\n",
       "      <td>2</td>\n",
       "      <td>4261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8581</th>\n",
       "      <td>260936</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>315000.0</td>\n",
       "      <td>962370.0</td>\n",
       "      <td>74605.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-1942.0</td>\n",
       "      <td>-6943.0</td>\n",
       "      <td>-1245</td>\n",
       "      <td>2</td>\n",
       "      <td>4270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8587</th>\n",
       "      <td>283893</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>227250.0</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>11587.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-1879.0</td>\n",
       "      <td>-8175.0</td>\n",
       "      <td>-838</td>\n",
       "      <td>2</td>\n",
       "      <td>4273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8589</th>\n",
       "      <td>323716</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>540000.0</td>\n",
       "      <td>29295.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-1834.0</td>\n",
       "      <td>-9525.0</td>\n",
       "      <td>1046</td>\n",
       "      <td>2</td>\n",
       "      <td>4274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8591</th>\n",
       "      <td>131471</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>121500.0</td>\n",
       "      <td>346500.0</td>\n",
       "      <td>22144.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-1723.0</td>\n",
       "      <td>-6391.0</td>\n",
       "      <td>-2140</td>\n",
       "      <td>2</td>\n",
       "      <td>4275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8595</th>\n",
       "      <td>397549</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>539100.0</td>\n",
       "      <td>27652.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-1614.0</td>\n",
       "      <td>-5782.0</td>\n",
       "      <td>-1038</td>\n",
       "      <td>2</td>\n",
       "      <td>4277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8609</th>\n",
       "      <td>371433</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>280170.0</td>\n",
       "      <td>29547.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-1348.0</td>\n",
       "      <td>-6300.0</td>\n",
       "      <td>-1067</td>\n",
       "      <td>2</td>\n",
       "      <td>4284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8617</th>\n",
       "      <td>103516</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>58500.0</td>\n",
       "      <td>55692.0</td>\n",
       "      <td>4594.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-1209.0</td>\n",
       "      <td>-6573.0</td>\n",
       "      <td>-963</td>\n",
       "      <td>2</td>\n",
       "      <td>4288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8631</th>\n",
       "      <td>186034</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>267322.5</td>\n",
       "      <td>24516.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-775.0</td>\n",
       "      <td>-6566.0</td>\n",
       "      <td>-573</td>\n",
       "      <td>2</td>\n",
       "      <td>4295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8643</th>\n",
       "      <td>395064</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>585000.0</td>\n",
       "      <td>25767.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-636.0</td>\n",
       "      <td>-7648.0</td>\n",
       "      <td>-1112</td>\n",
       "      <td>2</td>\n",
       "      <td>4301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8649</th>\n",
       "      <td>324146</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>126000.0</td>\n",
       "      <td>52128.0</td>\n",
       "      <td>6183.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-483.0</td>\n",
       "      <td>-6847.0</td>\n",
       "      <td>-398</td>\n",
       "      <td>2</td>\n",
       "      <td>4304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8661</th>\n",
       "      <td>419691</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>495000.0</td>\n",
       "      <td>25272.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-176.0</td>\n",
       "      <td>-7174.0</td>\n",
       "      <td>441</td>\n",
       "      <td>2</td>\n",
       "      <td>4310</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8665</th>\n",
       "      <td>201234</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>360000.0</td>\n",
       "      <td>15264.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-164.0</td>\n",
       "      <td>-8692.0</td>\n",
       "      <td>1129</td>\n",
       "      <td>2</td>\n",
       "      <td>4312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8667</th>\n",
       "      <td>280524</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>375408.0</td>\n",
       "      <td>29790.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-164.0</td>\n",
       "      <td>-8293.0</td>\n",
       "      <td>571</td>\n",
       "      <td>2</td>\n",
       "      <td>4313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8673</th>\n",
       "      <td>308442</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>78192.0</td>\n",
       "      <td>8010.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-65.0</td>\n",
       "      <td>-10537.0</td>\n",
       "      <td>-2363</td>\n",
       "      <td>2</td>\n",
       "      <td>4316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8689</th>\n",
       "      <td>338784</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>518071.5</td>\n",
       "      <td>40221.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-36.0</td>\n",
       "      <td>-11509.0</td>\n",
       "      <td>450</td>\n",
       "      <td>2</td>\n",
       "      <td>4324</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8695</th>\n",
       "      <td>287370</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>303489.0</td>\n",
       "      <td>22081.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-33.0</td>\n",
       "      <td>-7392.0</td>\n",
       "      <td>-155</td>\n",
       "      <td>2</td>\n",
       "      <td>4327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8701</th>\n",
       "      <td>179194</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>256500.0</td>\n",
       "      <td>331920.0</td>\n",
       "      <td>17077.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-31.0</td>\n",
       "      <td>-7295.0</td>\n",
       "      <td>-1334</td>\n",
       "      <td>2</td>\n",
       "      <td>4330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8707</th>\n",
       "      <td>285376</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>334152.0</td>\n",
       "      <td>17190.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-30.0</td>\n",
       "      <td>-7296.0</td>\n",
       "      <td>265</td>\n",
       "      <td>2</td>\n",
       "      <td>4333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8711</th>\n",
       "      <td>408256</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>517500.0</td>\n",
       "      <td>24894.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-24.0</td>\n",
       "      <td>-7289.0</td>\n",
       "      <td>-164</td>\n",
       "      <td>2</td>\n",
       "      <td>4335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8713</th>\n",
       "      <td>246700</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>376920.0</td>\n",
       "      <td>19372.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-21.0</td>\n",
       "      <td>-7299.0</td>\n",
       "      <td>264</td>\n",
       "      <td>2</td>\n",
       "      <td>4336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8715</th>\n",
       "      <td>322965</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>190764.0</td>\n",
       "      <td>12879.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-14.0</td>\n",
       "      <td>-7298.0</td>\n",
       "      <td>38</td>\n",
       "      <td>2</td>\n",
       "      <td>4337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8723</th>\n",
       "      <td>130302</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>216000.0</td>\n",
       "      <td>408330.0</td>\n",
       "      <td>20848.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.0</td>\n",
       "      <td>-7321.0</td>\n",
       "      <td>-783</td>\n",
       "      <td>2</td>\n",
       "      <td>4341</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8727</th>\n",
       "      <td>382111</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>539100.0</td>\n",
       "      <td>27652.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-7.0</td>\n",
       "      <td>-7323.0</td>\n",
       "      <td>37</td>\n",
       "      <td>2</td>\n",
       "      <td>4343</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8731</th>\n",
       "      <td>283683</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>166500.0</td>\n",
       "      <td>598500.0</td>\n",
       "      <td>30685.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-5.0</td>\n",
       "      <td>-8111.0</td>\n",
       "      <td>955</td>\n",
       "      <td>2</td>\n",
       "      <td>4345</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8737</th>\n",
       "      <td>189826</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>103500.0</td>\n",
       "      <td>222768.0</td>\n",
       "      <td>17991.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9773.0</td>\n",
       "      <td>-2763</td>\n",
       "      <td>2</td>\n",
       "      <td>4348</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8739</th>\n",
       "      <td>414635</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>67500.0</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>4725.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9648.0</td>\n",
       "      <td>1091</td>\n",
       "      <td>2</td>\n",
       "      <td>4349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8743</th>\n",
       "      <td>416761</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>597024.0</td>\n",
       "      <td>33466.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-7512.0</td>\n",
       "      <td>176</td>\n",
       "      <td>2</td>\n",
       "      <td>4351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8745</th>\n",
       "      <td>294463</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>67765.5</td>\n",
       "      <td>8172.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-7351.0</td>\n",
       "      <td>-1123</td>\n",
       "      <td>2</td>\n",
       "      <td>4352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8751</th>\n",
       "      <td>355174</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>360000.0</td>\n",
       "      <td>1024740.0</td>\n",
       "      <td>55588.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-7322.0</td>\n",
       "      <td>-915</td>\n",
       "      <td>2</td>\n",
       "      <td>4355</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1562 rows × 128 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      SK_ID_CURR  TARGET NAME_CONTRACT_TYPE CODE_GENDER FLAG_OWN_CAR  \\\n",
       "29        337039     NaN         Cash loans           F            N   \n",
       "53        128516     NaN         Cash loans           F            N   \n",
       "69        147294     NaN         Cash loans           M            N   \n",
       "83        286683     NaN         Cash loans           F            N   \n",
       "91        303083     NaN         Cash loans           M            Y   \n",
       "93        141114     NaN         Cash loans           M            Y   \n",
       "99        238419     NaN         Cash loans           M            Y   \n",
       "107       319192     NaN         Cash loans           F            N   \n",
       "111       165171     NaN         Cash loans           M            Y   \n",
       "113       190489     NaN         Cash loans           M            N   \n",
       "117       345999     NaN         Cash loans           F            N   \n",
       "121       197191     NaN         Cash loans           F            Y   \n",
       "131       407069     NaN         Cash loans           M            Y   \n",
       "137       129939     NaN         Cash loans           F            N   \n",
       "141       376354     NaN         Cash loans           F            Y   \n",
       "147       419788     NaN         Cash loans           M            N   \n",
       "153       273429     NaN         Cash loans           F            N   \n",
       "171       115705     NaN         Cash loans           M            N   \n",
       "173       304483     NaN         Cash loans           F            N   \n",
       "175       417778     NaN         Cash loans           F            Y   \n",
       "179       424262     NaN         Cash loans           F            N   \n",
       "187       199424     NaN         Cash loans           F            N   \n",
       "189       259228     NaN         Cash loans           F            N   \n",
       "191       267581     NaN         Cash loans           M            Y   \n",
       "207       263479     NaN         Cash loans           M            Y   \n",
       "213       308919     NaN         Cash loans           M            Y   \n",
       "223       320412     NaN         Cash loans           M            N   \n",
       "229       230122     NaN         Cash loans           M            N   \n",
       "245       292267     NaN         Cash loans           F            N   \n",
       "261       312997     NaN         Cash loans           M            Y   \n",
       "...          ...     ...                ...         ...          ...   \n",
       "8563      351091     NaN         Cash loans           F            N   \n",
       "8581      260936     NaN         Cash loans           M            N   \n",
       "8587      283893     NaN         Cash loans           F            N   \n",
       "8589      323716     NaN         Cash loans           F            Y   \n",
       "8591      131471     NaN         Cash loans           M            Y   \n",
       "8595      397549     NaN         Cash loans           F            N   \n",
       "8609      371433     NaN         Cash loans           M            Y   \n",
       "8617      103516     NaN         Cash loans           M            N   \n",
       "8631      186034     NaN         Cash loans           M            Y   \n",
       "8643      395064     NaN         Cash loans           F            N   \n",
       "8649      324146     NaN         Cash loans           F            N   \n",
       "8661      419691     NaN         Cash loans           F            Y   \n",
       "8665      201234     NaN         Cash loans           M            Y   \n",
       "8667      280524     NaN         Cash loans           M            N   \n",
       "8673      308442     NaN         Cash loans           F            N   \n",
       "8689      338784     NaN         Cash loans           M            Y   \n",
       "8695      287370     NaN         Cash loans           M            N   \n",
       "8701      179194     NaN         Cash loans           M            N   \n",
       "8707      285376     NaN         Cash loans           F            Y   \n",
       "8711      408256     NaN         Cash loans           M            N   \n",
       "8713      246700     NaN         Cash loans           F            N   \n",
       "8715      322965     NaN         Cash loans           F            N   \n",
       "8723      130302     NaN         Cash loans           F            N   \n",
       "8727      382111     NaN         Cash loans           F            N   \n",
       "8731      283683     NaN         Cash loans           F            N   \n",
       "8737      189826     NaN         Cash loans           F            N   \n",
       "8739      414635     NaN         Cash loans           F            N   \n",
       "8743      416761     NaN         Cash loans           F            N   \n",
       "8745      294463     NaN         Cash loans           M            N   \n",
       "8751      355174     NaN         Cash loans           F            N   \n",
       "\n",
       "     FLAG_OWN_REALTY  CNT_CHILDREN  AMT_INCOME_TOTAL  AMT_CREDIT  AMT_ANNUITY  \\\n",
       "29                 Y             0          225000.0    222768.0      16785.0   \n",
       "53                 Y             0          202500.0    272520.0      15772.5   \n",
       "69                 Y             0          193500.0    202500.0      13662.0   \n",
       "83                 Y             0           72000.0    373500.0      22977.0   \n",
       "91                 Y             0          225000.0    178213.5      16474.5   \n",
       "93                 N             0          180000.0    328405.5      26077.5   \n",
       "99                 Y             0          225000.0    790830.0      62482.5   \n",
       "107                Y             0          270000.0   1483650.0      61357.5   \n",
       "111                Y             0           90000.0     45000.0       4846.5   \n",
       "113                Y             0          177750.0    177768.0      11488.5   \n",
       "117                Y             0          292500.0    745429.5      32962.5   \n",
       "121                Y             0          360000.0    810000.0      51763.5   \n",
       "131                Y             0          180000.0    177768.0      13063.5   \n",
       "137                Y             0          157500.0     52128.0       5602.5   \n",
       "141                Y             0          157500.0    254799.0      20259.0   \n",
       "147                N             0          225000.0    450000.0      32746.5   \n",
       "153                Y             0          112500.0    189000.0       9778.5   \n",
       "171                Y             0          225000.0    296505.0      27324.0   \n",
       "173                Y             0          135000.0    479700.0      50503.5   \n",
       "175                Y             0          270000.0    675000.0      28728.0   \n",
       "179                Y             0          202500.0    350181.0      34762.5   \n",
       "187                Y             0          153000.0    296280.0      15255.0   \n",
       "189                N             0          270000.0   1062000.0      38277.0   \n",
       "191                N             2          247500.0   1071000.0      34677.0   \n",
       "207                Y             0          157500.0    382500.0      19660.5   \n",
       "213                Y             0          202500.0    457312.5      29353.5   \n",
       "223                Y             0           90000.0    756504.0      24534.0   \n",
       "229                Y             0          202500.0    320922.0      38214.0   \n",
       "245                Y             0          202500.0    324000.0      20704.5   \n",
       "261                Y             0          225000.0    797818.5      40864.5   \n",
       "...              ...           ...               ...         ...          ...   \n",
       "8563               Y             1          135000.0    398160.0      25573.5   \n",
       "8581               Y             1          315000.0    962370.0      74605.5   \n",
       "8587               Y             0          227250.0    270000.0      11587.5   \n",
       "8589               Y             0          135000.0    540000.0      29295.0   \n",
       "8591               Y             0          121500.0    346500.0      22144.5   \n",
       "8595               N             2          112500.0    539100.0      27652.5   \n",
       "8609               Y             1          135000.0    280170.0      29547.0   \n",
       "8617               Y             0           58500.0     55692.0       4594.5   \n",
       "8631               N             0          157500.0    267322.5      24516.0   \n",
       "8643               N             2           90000.0    585000.0      25767.0   \n",
       "8649               N             1          126000.0     52128.0       6183.0   \n",
       "8661               N             1          157500.0    495000.0      25272.0   \n",
       "8665               Y             1          135000.0    360000.0      15264.0   \n",
       "8667               Y             0          202500.0    375408.0      29790.0   \n",
       "8673               Y             0           90000.0     78192.0       8010.0   \n",
       "8689               Y             0          450000.0    518071.5      40221.0   \n",
       "8695               Y             0          135000.0    303489.0      22081.5   \n",
       "8701               Y             1          256500.0    331920.0      17077.5   \n",
       "8707               Y             1          135000.0    334152.0      17190.0   \n",
       "8711               N             0          180000.0    517500.0      24894.0   \n",
       "8713               N             0          112500.0    376920.0      19372.5   \n",
       "8715               N             0          135000.0    190764.0      12879.0   \n",
       "8723               Y             0          216000.0    408330.0      20848.5   \n",
       "8727               Y             0          157500.0    539100.0      27652.5   \n",
       "8731               N             0          166500.0    598500.0      30685.5   \n",
       "8737               Y             1          103500.0    222768.0      17991.0   \n",
       "8739               Y             1           67500.0     90000.0       4725.0   \n",
       "8743               Y             0          157500.0    597024.0      33466.5   \n",
       "8745               N             0          135000.0     67765.5       8172.0   \n",
       "8751               Y             0          360000.0   1024740.0      55588.5   \n",
       "\n",
       "       ...    AMT_REQ_CREDIT_BUREAU_WEEK AMT_REQ_CREDIT_BUREAU_MON  \\\n",
       "29     ...                           0.0                       0.0   \n",
       "53     ...                           0.0                       0.0   \n",
       "69     ...                           0.0                       0.0   \n",
       "83     ...                           0.0                       0.0   \n",
       "91     ...                           0.0                       0.0   \n",
       "93     ...                           0.0                       0.0   \n",
       "99     ...                           0.0                       0.0   \n",
       "107    ...                           0.0                       0.0   \n",
       "111    ...                           0.0                       0.0   \n",
       "113    ...                           NaN                       NaN   \n",
       "117    ...                           0.0                       0.0   \n",
       "121    ...                           0.0                       0.0   \n",
       "131    ...                           0.0                       0.0   \n",
       "137    ...                           0.0                       0.0   \n",
       "141    ...                           0.0                       0.0   \n",
       "147    ...                           NaN                       NaN   \n",
       "153    ...                           0.0                       0.0   \n",
       "171    ...                           0.0                       0.0   \n",
       "173    ...                           0.0                       0.0   \n",
       "175    ...                           0.0                       0.0   \n",
       "179    ...                           0.0                       0.0   \n",
       "187    ...                           0.0                       0.0   \n",
       "189    ...                           0.0                       0.0   \n",
       "191    ...                           NaN                       NaN   \n",
       "207    ...                           0.0                       0.0   \n",
       "213    ...                           0.0                       0.0   \n",
       "223    ...                           0.0                       0.0   \n",
       "229    ...                           0.0                       0.0   \n",
       "245    ...                           0.0                       0.0   \n",
       "261    ...                           0.0                       0.0   \n",
       "...    ...                           ...                       ...   \n",
       "8563   ...                           0.0                       0.0   \n",
       "8581   ...                           0.0                       0.0   \n",
       "8587   ...                           NaN                       NaN   \n",
       "8589   ...                           0.0                       0.0   \n",
       "8591   ...                           0.0                       0.0   \n",
       "8595   ...                           0.0                       0.0   \n",
       "8609   ...                           0.0                       0.0   \n",
       "8617   ...                           NaN                       NaN   \n",
       "8631   ...                           0.0                       0.0   \n",
       "8643   ...                           0.0                       0.0   \n",
       "8649   ...                           0.0                       0.0   \n",
       "8661   ...                           0.0                       0.0   \n",
       "8665   ...                           NaN                       NaN   \n",
       "8667   ...                           0.0                       0.0   \n",
       "8673   ...                           0.0                       0.0   \n",
       "8689   ...                           0.0                       0.0   \n",
       "8695   ...                           0.0                       0.0   \n",
       "8701   ...                           0.0                       0.0   \n",
       "8707   ...                           0.0                       0.0   \n",
       "8711   ...                           NaN                       NaN   \n",
       "8713   ...                           0.0                       0.0   \n",
       "8715   ...                           0.0                       0.0   \n",
       "8723   ...                           0.0                       0.0   \n",
       "8727   ...                           0.0                       0.0   \n",
       "8731   ...                           NaN                       NaN   \n",
       "8737   ...                           0.0                       0.0   \n",
       "8739   ...                           0.0                       0.0   \n",
       "8743   ...                           NaN                       NaN   \n",
       "8745   ...                           NaN                       NaN   \n",
       "8751   ...                           0.0                       0.0   \n",
       "\n",
       "     AMT_REQ_CREDIT_BUREAU_QRT AMT_REQ_CREDIT_BUREAU_YEAR is_train  \\\n",
       "29                         0.0                        3.0        0   \n",
       "53                         0.0                        4.0        0   \n",
       "69                         0.0                        5.0        0   \n",
       "83                         0.0                        3.0        0   \n",
       "91                         0.0                        0.0        0   \n",
       "93                         0.0                        4.0        0   \n",
       "99                         1.0                        1.0        0   \n",
       "107                        0.0                        3.0        0   \n",
       "111                        1.0                        5.0        0   \n",
       "113                        NaN                        NaN        0   \n",
       "117                        0.0                        4.0        0   \n",
       "121                        0.0                        6.0        0   \n",
       "131                        1.0                        0.0        0   \n",
       "137                        1.0                        6.0        0   \n",
       "141                        0.0                        3.0        0   \n",
       "147                        NaN                        NaN        0   \n",
       "153                        0.0                        2.0        0   \n",
       "171                        0.0                        0.0        0   \n",
       "173                        0.0                        2.0        0   \n",
       "175                        0.0                        0.0        0   \n",
       "179                        1.0                        3.0        0   \n",
       "187                        0.0                        8.0        0   \n",
       "189                        0.0                        4.0        0   \n",
       "191                        NaN                        NaN        0   \n",
       "207                        0.0                        7.0        0   \n",
       "213                        0.0                        2.0        0   \n",
       "223                        1.0                        1.0        0   \n",
       "229                        1.0                        6.0        0   \n",
       "245                        1.0                        3.0        0   \n",
       "261                        0.0                        3.0        0   \n",
       "...                        ...                        ...      ...   \n",
       "8563                       1.0                        7.0        0   \n",
       "8581                       0.0                        7.0        0   \n",
       "8587                       NaN                        NaN        0   \n",
       "8589                       0.0                        0.0        0   \n",
       "8591                       0.0                        0.0        0   \n",
       "8595                       0.0                        4.0        0   \n",
       "8609                       1.0                        2.0        0   \n",
       "8617                       NaN                        NaN        0   \n",
       "8631                       0.0                        6.0        0   \n",
       "8643                       0.0                        0.0        0   \n",
       "8649                       1.0                        7.0        0   \n",
       "8661                       0.0                        4.0        0   \n",
       "8665                       NaN                        NaN        0   \n",
       "8667                       0.0                        9.0        0   \n",
       "8673                       1.0                        4.0        0   \n",
       "8689                       0.0                        3.0        0   \n",
       "8695                       0.0                        1.0        0   \n",
       "8701                       0.0                        3.0        0   \n",
       "8707                       0.0                        1.0        0   \n",
       "8711                       NaN                        NaN        0   \n",
       "8713                       0.0                        1.0        0   \n",
       "8715                       0.0                        5.0        0   \n",
       "8723                       0.0                        0.0        0   \n",
       "8727                       0.0                        4.0        0   \n",
       "8731                       NaN                        NaN        0   \n",
       "8737                       0.0                        0.0        0   \n",
       "8739                       0.0                        2.0        0   \n",
       "8743                       NaN                        NaN        0   \n",
       "8745                       NaN                        NaN        0   \n",
       "8751                       2.0                        3.0        0   \n",
       "\n",
       "     DAYS_BIRTH-m-DAYS_REGISTRATION  DAYS_REGISTRATION-m-DAYS_ID_PUBLISH  \\\n",
       "29                         -21327.0                               4065.0   \n",
       "53                         -20723.0                               2073.0   \n",
       "69                         -20251.0                               3382.0   \n",
       "83                         -19966.0                               3042.0   \n",
       "91                         -19896.0                               2904.0   \n",
       "93                         -19857.0                               1664.0   \n",
       "99                         -19833.0                               2682.0   \n",
       "107                        -19769.0                               3319.0   \n",
       "111                        -19725.0                                105.0   \n",
       "113                        -19685.0                               2849.0   \n",
       "117                        -19587.0                               2911.0   \n",
       "121                        -19519.0                               3030.0   \n",
       "131                        -19412.0                               2927.0   \n",
       "137                        -19343.0                                 37.0   \n",
       "141                        -19334.0                               2681.0   \n",
       "147                        -19310.0                                 14.0   \n",
       "153                        -19279.0                               2841.0   \n",
       "171                        -19142.0                                267.0   \n",
       "173                        -19115.0                               2378.0   \n",
       "175                        -19114.0                                  0.0   \n",
       "179                        -19106.0                               2542.0   \n",
       "187                        -19034.0                               2580.0   \n",
       "189                        -19024.0                               2545.0   \n",
       "191                        -18982.0                               2532.0   \n",
       "207                        -18916.0                               2454.0   \n",
       "213                        -18866.0                               2392.0   \n",
       "223                        -18812.0                               1285.0   \n",
       "229                        -18788.0                               2345.0   \n",
       "245                        -18694.0                                  0.0   \n",
       "261                        -18636.0                               2182.0   \n",
       "...                             ...                                  ...   \n",
       "8563                        -2588.0                              -6292.0   \n",
       "8581                        -1942.0                              -6943.0   \n",
       "8587                        -1879.0                              -8175.0   \n",
       "8589                        -1834.0                              -9525.0   \n",
       "8591                        -1723.0                              -6391.0   \n",
       "8595                        -1614.0                              -5782.0   \n",
       "8609                        -1348.0                              -6300.0   \n",
       "8617                        -1209.0                              -6573.0   \n",
       "8631                         -775.0                              -6566.0   \n",
       "8643                         -636.0                              -7648.0   \n",
       "8649                         -483.0                              -6847.0   \n",
       "8661                         -176.0                              -7174.0   \n",
       "8665                         -164.0                              -8692.0   \n",
       "8667                         -164.0                              -8293.0   \n",
       "8673                          -65.0                             -10537.0   \n",
       "8689                          -36.0                             -11509.0   \n",
       "8695                          -33.0                              -7392.0   \n",
       "8701                          -31.0                              -7295.0   \n",
       "8707                          -30.0                              -7296.0   \n",
       "8711                          -24.0                              -7289.0   \n",
       "8713                          -21.0                              -7299.0   \n",
       "8715                          -14.0                              -7298.0   \n",
       "8723                           -9.0                              -7321.0   \n",
       "8727                           -7.0                              -7323.0   \n",
       "8731                           -5.0                              -8111.0   \n",
       "8737                            0.0                              -9773.0   \n",
       "8739                            0.0                              -9648.0   \n",
       "8743                            0.0                              -7512.0   \n",
       "8745                            0.0                              -7351.0   \n",
       "8751                            0.0                              -7322.0   \n",
       "\n",
       "      DAYS_ID_PUBLISH-m-DAYS_EMPLOYED  dup_cnt  dup_id  \n",
       "29                              -2883        2      14  \n",
       "53                               5075        2      26  \n",
       "69                               1682        2      34  \n",
       "83                              -2160        2      41  \n",
       "91                                -25        2      45  \n",
       "93                              -1703        2      46  \n",
       "99                                728        2      49  \n",
       "107                              1065        2      53  \n",
       "111                              -864        2      55  \n",
       "113                             -3169        2      56  \n",
       "117                               618        2      58  \n",
       "121                              5811        2      60  \n",
       "131                              -330        2      65  \n",
       "137                               759        2      68  \n",
       "141                             -2809        2      70  \n",
       "147                              2606        2      73  \n",
       "153                               564        2      76  \n",
       "171                              -292        2      85  \n",
       "173                             -2389        2      86  \n",
       "175                             -1579        2      87  \n",
       "179                              -481        2      89  \n",
       "187                             -1946        2      93  \n",
       "189                             -1240        2      94  \n",
       "191                             -2680        2      95  \n",
       "207                             -1527        2     103  \n",
       "213                              4510        2     106  \n",
       "223                              4368        2     111  \n",
       "229                              -129        2     114  \n",
       "245                              -727        2     122  \n",
       "261                               -22        2     130  \n",
       "...                               ...      ...     ...  \n",
       "8563                              678        2    4261  \n",
       "8581                            -1245        2    4270  \n",
       "8587                             -838        2    4273  \n",
       "8589                             1046        2    4274  \n",
       "8591                            -2140        2    4275  \n",
       "8595                            -1038        2    4277  \n",
       "8609                            -1067        2    4284  \n",
       "8617                             -963        2    4288  \n",
       "8631                             -573        2    4295  \n",
       "8643                            -1112        2    4301  \n",
       "8649                             -398        2    4304  \n",
       "8661                              441        2    4310  \n",
       "8665                             1129        2    4312  \n",
       "8667                              571        2    4313  \n",
       "8673                            -2363        2    4316  \n",
       "8689                              450        2    4324  \n",
       "8695                             -155        2    4327  \n",
       "8701                            -1334        2    4330  \n",
       "8707                              265        2    4333  \n",
       "8711                             -164        2    4335  \n",
       "8713                              264        2    4336  \n",
       "8715                               38        2    4337  \n",
       "8723                             -783        2    4341  \n",
       "8727                               37        2    4343  \n",
       "8731                              955        2    4345  \n",
       "8737                            -2763        2    4348  \n",
       "8739                             1091        2    4349  \n",
       "8743                              176        2    4351  \n",
       "8745                            -1123        2    4352  \n",
       "8751                             -915        2    4355  \n",
       "\n",
       "[1562 rows x 128 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup[dup.dup_id.isin(dup_id_test_t0)][dup.is_train==0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:03.072288Z",
     "start_time": "2018-08-25T11:27:03.020966Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>CODE_GENDER</th>\n",
       "      <th>FLAG_OWN_CAR</th>\n",
       "      <th>FLAG_OWN_REALTY</th>\n",
       "      <th>CNT_CHILDREN</th>\n",
       "      <th>AMT_INCOME_TOTAL</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>...</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_WEEK</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_MON</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_QRT</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_YEAR</th>\n",
       "      <th>is_train</th>\n",
       "      <th>DAYS_BIRTH-m-DAYS_REGISTRATION</th>\n",
       "      <th>DAYS_REGISTRATION-m-DAYS_ID_PUBLISH</th>\n",
       "      <th>DAYS_ID_PUBLISH-m-DAYS_EMPLOYED</th>\n",
       "      <th>dup_cnt</th>\n",
       "      <th>dup_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>809</th>\n",
       "      <td>311157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>22977.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-16339.0</td>\n",
       "      <td>-137.0</td>\n",
       "      <td>2571</td>\n",
       "      <td>2</td>\n",
       "      <td>403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1273</th>\n",
       "      <td>316815</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>260725.5</td>\n",
       "      <td>20596.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-14908.0</td>\n",
       "      <td>-1556.0</td>\n",
       "      <td>60</td>\n",
       "      <td>2</td>\n",
       "      <td>634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1485</th>\n",
       "      <td>288138</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>292500.0</td>\n",
       "      <td>417708.0</td>\n",
       "      <td>30523.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-14466.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1571</td>\n",
       "      <td>2</td>\n",
       "      <td>740</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1503</th>\n",
       "      <td>108045</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>278505.0</td>\n",
       "      <td>22131.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-14416.0</td>\n",
       "      <td>3087.0</td>\n",
       "      <td>-264</td>\n",
       "      <td>2</td>\n",
       "      <td>749</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1579</th>\n",
       "      <td>288876</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>247500.0</td>\n",
       "      <td>582804.0</td>\n",
       "      <td>29884.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-14240.0</td>\n",
       "      <td>3122.0</td>\n",
       "      <td>-3140</td>\n",
       "      <td>2</td>\n",
       "      <td>787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2120</th>\n",
       "      <td>445047</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>3</td>\n",
       "      <td>103500.0</td>\n",
       "      <td>132021.0</td>\n",
       "      <td>11331.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-13224.0</td>\n",
       "      <td>2680.0</td>\n",
       "      <td>-2762</td>\n",
       "      <td>2</td>\n",
       "      <td>1056</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2250</th>\n",
       "      <td>137651</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>601470.0</td>\n",
       "      <td>30838.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-13007.0</td>\n",
       "      <td>-3584.0</td>\n",
       "      <td>-2760</td>\n",
       "      <td>2</td>\n",
       "      <td>1121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2686</th>\n",
       "      <td>310586</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>301401.0</td>\n",
       "      <td>13779.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-12394.0</td>\n",
       "      <td>-4075.0</td>\n",
       "      <td>6245</td>\n",
       "      <td>2</td>\n",
       "      <td>1338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3563</th>\n",
       "      <td>140996</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>509400.0</td>\n",
       "      <td>40374.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-11225.0</td>\n",
       "      <td>-5242.0</td>\n",
       "      <td>-2434</td>\n",
       "      <td>2</td>\n",
       "      <td>1775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3718</th>\n",
       "      <td>268602</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>23107.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-11046.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>446</td>\n",
       "      <td>2</td>\n",
       "      <td>1852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3804</th>\n",
       "      <td>362872</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>171000.0</td>\n",
       "      <td>376920.0</td>\n",
       "      <td>16731.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-10917.0</td>\n",
       "      <td>-5569.0</td>\n",
       "      <td>-281</td>\n",
       "      <td>2</td>\n",
       "      <td>1895</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4060</th>\n",
       "      <td>279778</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>366588.0</td>\n",
       "      <td>28498.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-10609.0</td>\n",
       "      <td>1499.0</td>\n",
       "      <td>1476</td>\n",
       "      <td>2</td>\n",
       "      <td>2023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4242</th>\n",
       "      <td>381203</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>54000.0</td>\n",
       "      <td>265500.0</td>\n",
       "      <td>11290.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-10409.0</td>\n",
       "      <td>2226.0</td>\n",
       "      <td>-882</td>\n",
       "      <td>2</td>\n",
       "      <td>2114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4282</th>\n",
       "      <td>134494</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>67500.0</td>\n",
       "      <td>136287.0</td>\n",
       "      <td>8838.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-10351.0</td>\n",
       "      <td>2672.0</td>\n",
       "      <td>-3771</td>\n",
       "      <td>2</td>\n",
       "      <td>2134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4286</th>\n",
       "      <td>222303</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>265536.0</td>\n",
       "      <td>13684.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-10331.0</td>\n",
       "      <td>-6948.0</td>\n",
       "      <td>-952</td>\n",
       "      <td>2</td>\n",
       "      <td>2136</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4630</th>\n",
       "      <td>145157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>2</td>\n",
       "      <td>81000.0</td>\n",
       "      <td>72981.0</td>\n",
       "      <td>8788.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-9940.0</td>\n",
       "      <td>1812.0</td>\n",
       "      <td>-1782</td>\n",
       "      <td>2</td>\n",
       "      <td>2306</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4664</th>\n",
       "      <td>119813</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>104256.0</td>\n",
       "      <td>12370.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-9897.0</td>\n",
       "      <td>-1047.0</td>\n",
       "      <td>-2430</td>\n",
       "      <td>2</td>\n",
       "      <td>2323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4692</th>\n",
       "      <td>282317</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>109453.5</td>\n",
       "      <td>13117.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-9875.0</td>\n",
       "      <td>2362.0</td>\n",
       "      <td>-931</td>\n",
       "      <td>2</td>\n",
       "      <td>2337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4826</th>\n",
       "      <td>401332</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>224149.5</td>\n",
       "      <td>26730.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-9728.0</td>\n",
       "      <td>1074.0</td>\n",
       "      <td>-1653</td>\n",
       "      <td>2</td>\n",
       "      <td>2404</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4830</th>\n",
       "      <td>419787</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>3</td>\n",
       "      <td>54000.0</td>\n",
       "      <td>341280.0</td>\n",
       "      <td>21937.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-9724.0</td>\n",
       "      <td>-782.0</td>\n",
       "      <td>-2385</td>\n",
       "      <td>2</td>\n",
       "      <td>2406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5346</th>\n",
       "      <td>421998</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>806661.0</td>\n",
       "      <td>30541.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-9070.0</td>\n",
       "      <td>-354.0</td>\n",
       "      <td>-1119</td>\n",
       "      <td>2</td>\n",
       "      <td>2663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5570</th>\n",
       "      <td>427067</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>7020.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-8802.0</td>\n",
       "      <td>1485.0</td>\n",
       "      <td>-1226</td>\n",
       "      <td>2</td>\n",
       "      <td>2775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6056</th>\n",
       "      <td>213957</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>2</td>\n",
       "      <td>202500.0</td>\n",
       "      <td>284427.0</td>\n",
       "      <td>22599.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-8180.0</td>\n",
       "      <td>-6614.0</td>\n",
       "      <td>967</td>\n",
       "      <td>2</td>\n",
       "      <td>3016</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6092</th>\n",
       "      <td>281876</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>2</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>13095.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-8113.0</td>\n",
       "      <td>-6220.0</td>\n",
       "      <td>-19</td>\n",
       "      <td>2</td>\n",
       "      <td>3034</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6229</th>\n",
       "      <td>224488</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>126000.0</td>\n",
       "      <td>6570.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-7933.0</td>\n",
       "      <td>505.0</td>\n",
       "      <td>-2525</td>\n",
       "      <td>2</td>\n",
       "      <td>3102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6811</th>\n",
       "      <td>152833</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>1326352.5</td>\n",
       "      <td>42916.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-7135.0</td>\n",
       "      <td>-2354.0</td>\n",
       "      <td>-156</td>\n",
       "      <td>2</td>\n",
       "      <td>3392</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7159</th>\n",
       "      <td>273336</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>285453.0</td>\n",
       "      <td>14701.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6441.0</td>\n",
       "      <td>-2821.0</td>\n",
       "      <td>-4891</td>\n",
       "      <td>2</td>\n",
       "      <td>3566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7482</th>\n",
       "      <td>381121</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>315000.0</td>\n",
       "      <td>792162.0</td>\n",
       "      <td>43101.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6104.0</td>\n",
       "      <td>-1374.0</td>\n",
       "      <td>-2503</td>\n",
       "      <td>2</td>\n",
       "      <td>3726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7533</th>\n",
       "      <td>317227</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>144000.0</td>\n",
       "      <td>312768.0</td>\n",
       "      <td>24840.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6074.0</td>\n",
       "      <td>-3019.0</td>\n",
       "      <td>1265</td>\n",
       "      <td>2</td>\n",
       "      <td>3751</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7541</th>\n",
       "      <td>423503</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>2</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>180000.0</td>\n",
       "      <td>14350.5</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6073.0</td>\n",
       "      <td>-1620.0</td>\n",
       "      <td>-1713</td>\n",
       "      <td>2</td>\n",
       "      <td>3755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7578</th>\n",
       "      <td>358955</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>269982.0</td>\n",
       "      <td>28480.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6053.0</td>\n",
       "      <td>-2036.0</td>\n",
       "      <td>-172</td>\n",
       "      <td>3</td>\n",
       "      <td>3773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7613</th>\n",
       "      <td>338581</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>195543.0</td>\n",
       "      <td>15579.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6038.0</td>\n",
       "      <td>-1657.0</td>\n",
       "      <td>-2079</td>\n",
       "      <td>2</td>\n",
       "      <td>3790</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7681</th>\n",
       "      <td>407091</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>195543.0</td>\n",
       "      <td>15579.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5992.0</td>\n",
       "      <td>-3292.0</td>\n",
       "      <td>-1324</td>\n",
       "      <td>2</td>\n",
       "      <td>3824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7778</th>\n",
       "      <td>209288</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>Y</td>\n",
       "      <td>1</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>93829.5</td>\n",
       "      <td>11263.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5951.0</td>\n",
       "      <td>-2465.0</td>\n",
       "      <td>-2384</td>\n",
       "      <td>2</td>\n",
       "      <td>3872</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7921</th>\n",
       "      <td>401230</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>85500.0</td>\n",
       "      <td>265536.0</td>\n",
       "      <td>14535.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5896.0</td>\n",
       "      <td>-4414.0</td>\n",
       "      <td>-4894</td>\n",
       "      <td>2</td>\n",
       "      <td>3942</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7937</th>\n",
       "      <td>293996</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>135000.0</td>\n",
       "      <td>296280.0</td>\n",
       "      <td>23539.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5890.0</td>\n",
       "      <td>-4369.0</td>\n",
       "      <td>-1820</td>\n",
       "      <td>2</td>\n",
       "      <td>3950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8123</th>\n",
       "      <td>103171</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>157500.0</td>\n",
       "      <td>291114.0</td>\n",
       "      <td>22657.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5825.0</td>\n",
       "      <td>-1718.0</td>\n",
       "      <td>-1560</td>\n",
       "      <td>2</td>\n",
       "      <td>4042</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8161</th>\n",
       "      <td>175737</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>N</td>\n",
       "      <td>N</td>\n",
       "      <td>0</td>\n",
       "      <td>252000.0</td>\n",
       "      <td>248760.0</td>\n",
       "      <td>29650.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>-5746.0</td>\n",
       "      <td>-3361.0</td>\n",
       "      <td>1176</td>\n",
       "      <td>2</td>\n",
       "      <td>4061</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8217</th>\n",
       "      <td>370844</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>F</td>\n",
       "      <td>Y</td>\n",
       "      <td>Y</td>\n",
       "      <td>0</td>\n",
       "      <td>67500.0</td>\n",
       "      <td>278460.0</td>\n",
       "      <td>21676.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-5617.0</td>\n",
       "      <td>-2974.0</td>\n",
       "      <td>66</td>\n",
       "      <td>2</td>\n",
       "      <td>4089</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>39 rows × 128 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      SK_ID_CURR  TARGET NAME_CONTRACT_TYPE CODE_GENDER FLAG_OWN_CAR  \\\n",
       "809       311157     NaN         Cash loans           F            N   \n",
       "1273      316815     NaN         Cash loans           F            N   \n",
       "1485      288138     NaN         Cash loans           M            Y   \n",
       "1503      108045     NaN         Cash loans           F            N   \n",
       "1579      288876     NaN         Cash loans           F            Y   \n",
       "2120      445047     NaN         Cash loans           F            N   \n",
       "2250      137651     NaN         Cash loans           M            Y   \n",
       "2686      310586     NaN         Cash loans           F            Y   \n",
       "3563      140996     NaN         Cash loans           M            N   \n",
       "3718      268602     NaN         Cash loans           F            N   \n",
       "3804      362872     NaN         Cash loans           M            N   \n",
       "4060      279778     NaN         Cash loans           F            N   \n",
       "4242      381203     NaN         Cash loans           F            N   \n",
       "4282      134494     NaN         Cash loans           F            N   \n",
       "4286      222303     NaN         Cash loans           M            N   \n",
       "4630      145157     NaN         Cash loans           F            N   \n",
       "4664      119813     NaN         Cash loans           M            Y   \n",
       "4692      282317     NaN         Cash loans           M            N   \n",
       "4826      401332     NaN         Cash loans           F            N   \n",
       "4830      419787     NaN         Cash loans           F            N   \n",
       "5346      421998     NaN         Cash loans           F            Y   \n",
       "5570      427067     NaN         Cash loans           F            N   \n",
       "6056      213957     NaN         Cash loans           F            N   \n",
       "6092      281876     NaN         Cash loans           M            Y   \n",
       "6229      224488     NaN         Cash loans           M            N   \n",
       "6811      152833     NaN         Cash loans           F            N   \n",
       "7159      273336     NaN         Cash loans           F            N   \n",
       "7482      381121     NaN         Cash loans           M            Y   \n",
       "7533      317227     NaN         Cash loans           F            N   \n",
       "7541      423503     NaN         Cash loans           F            N   \n",
       "7578      358955     NaN         Cash loans           M            Y   \n",
       "7613      338581     NaN         Cash loans           F            Y   \n",
       "7681      407091     NaN         Cash loans           M            N   \n",
       "7778      209288     NaN         Cash loans           F            N   \n",
       "7921      401230     NaN         Cash loans           F            N   \n",
       "7937      293996     NaN         Cash loans           M            N   \n",
       "8123      103171     NaN         Cash loans           M            Y   \n",
       "8161      175737     NaN         Cash loans           F            N   \n",
       "8217      370844     NaN         Cash loans           F            Y   \n",
       "\n",
       "     FLAG_OWN_REALTY  CNT_CHILDREN  AMT_INCOME_TOTAL  AMT_CREDIT  AMT_ANNUITY  \\\n",
       "809                N             0          270000.0    450000.0      22977.0   \n",
       "1273               N             0          135000.0    260725.5      20596.5   \n",
       "1485               N             0          292500.0    417708.0      30523.5   \n",
       "1503               Y             0          112500.0    278505.0      22131.0   \n",
       "1579               Y             1          247500.0    582804.0      29884.5   \n",
       "2120               Y             3          103500.0    132021.0      11331.0   \n",
       "2250               Y             0          180000.0    601470.0      30838.5   \n",
       "2686               Y             0          157500.0    301401.0      13779.0   \n",
       "3563               Y             0          135000.0    509400.0      40374.0   \n",
       "3718               Y             0          135000.0    450000.0      23107.5   \n",
       "3804               Y             0          171000.0    376920.0      16731.0   \n",
       "4060               N             0          112500.0    366588.0      28498.5   \n",
       "4242               Y             1           54000.0    265500.0      11290.5   \n",
       "4282               Y             1           67500.0    136287.0       8838.0   \n",
       "4286               Y             0          202500.0    265536.0      13684.5   \n",
       "4630               Y             2           81000.0     72981.0       8788.5   \n",
       "4664               N             1          180000.0    104256.0      12370.5   \n",
       "4692               N             0           90000.0    109453.5      13117.5   \n",
       "4826               Y             0          202500.0    224149.5      26730.0   \n",
       "4830               Y             3           54000.0    341280.0      21937.5   \n",
       "5346               Y             0          202500.0    806661.0      30541.5   \n",
       "5570               Y             1          112500.0    135000.0       7020.0   \n",
       "6056               Y             2          202500.0    284427.0      22599.0   \n",
       "6092               Y             2          225000.0    180000.0      13095.0   \n",
       "6229               N             0          135000.0    126000.0       6570.0   \n",
       "6811               Y             1          112500.0   1326352.5      42916.5   \n",
       "7159               Y             1          157500.0    285453.0      14701.5   \n",
       "7482               Y             1          315000.0    792162.0      43101.0   \n",
       "7533               Y             0          144000.0    312768.0      24840.0   \n",
       "7541               Y             2          157500.0    180000.0      14350.5   \n",
       "7578               N             1          225000.0    269982.0      28480.5   \n",
       "7613               N             2          135000.0    195543.0      15579.0   \n",
       "7681               N             1          112500.0    195543.0      15579.0   \n",
       "7778               Y             1          157500.0     93829.5      11263.5   \n",
       "7921               N             1           85500.0    265536.0      14535.0   \n",
       "7937               N             0          135000.0    296280.0      23539.5   \n",
       "8123               Y             0          157500.0    291114.0      22657.5   \n",
       "8161               N             0          252000.0    248760.0      29650.5   \n",
       "8217               Y             0           67500.0    278460.0      21676.5   \n",
       "\n",
       "       ...    AMT_REQ_CREDIT_BUREAU_WEEK AMT_REQ_CREDIT_BUREAU_MON  \\\n",
       "809    ...                           0.0                       0.0   \n",
       "1273   ...                           0.0                       0.0   \n",
       "1485   ...                           0.0                       0.0   \n",
       "1503   ...                           0.0                       0.0   \n",
       "1579   ...                           0.0                       0.0   \n",
       "2120   ...                           0.0                       0.0   \n",
       "2250   ...                           0.0                       0.0   \n",
       "2686   ...                           0.0                       0.0   \n",
       "3563   ...                           1.0                       0.0   \n",
       "3718   ...                           0.0                       0.0   \n",
       "3804   ...                           0.0                       0.0   \n",
       "4060   ...                           0.0                       0.0   \n",
       "4242   ...                           0.0                       0.0   \n",
       "4282   ...                           NaN                       NaN   \n",
       "4286   ...                           0.0                       0.0   \n",
       "4630   ...                           NaN                       NaN   \n",
       "4664   ...                           0.0                       0.0   \n",
       "4692   ...                           NaN                       NaN   \n",
       "4826   ...                           0.0                       0.0   \n",
       "4830   ...                           0.0                       0.0   \n",
       "5346   ...                           0.0                       0.0   \n",
       "5570   ...                           0.0                       0.0   \n",
       "6056   ...                           0.0                       0.0   \n",
       "6092   ...                           0.0                       0.0   \n",
       "6229   ...                           0.0                       0.0   \n",
       "6811   ...                           0.0                       0.0   \n",
       "7159   ...                           0.0                       0.0   \n",
       "7482   ...                           0.0                       0.0   \n",
       "7533   ...                           0.0                       0.0   \n",
       "7541   ...                           1.0                       0.0   \n",
       "7578   ...                           0.0                       0.0   \n",
       "7613   ...                           0.0                       0.0   \n",
       "7681   ...                           0.0                       0.0   \n",
       "7778   ...                           0.0                       0.0   \n",
       "7921   ...                           0.0                       0.0   \n",
       "7937   ...                           0.0                       0.0   \n",
       "8123   ...                           0.0                       0.0   \n",
       "8161   ...                           NaN                       NaN   \n",
       "8217   ...                           0.0                       0.0   \n",
       "\n",
       "     AMT_REQ_CREDIT_BUREAU_QRT AMT_REQ_CREDIT_BUREAU_YEAR is_train  \\\n",
       "809                        1.0                        3.0        0   \n",
       "1273                       0.0                        7.0        0   \n",
       "1485                       0.0                        2.0        0   \n",
       "1503                       0.0                        0.0        0   \n",
       "1579                       1.0                        1.0        0   \n",
       "2120                       0.0                        1.0        0   \n",
       "2250                       2.0                        0.0        0   \n",
       "2686                       0.0                        4.0        0   \n",
       "3563                       0.0                        1.0        0   \n",
       "3718                       1.0                        7.0        0   \n",
       "3804                       0.0                        6.0        0   \n",
       "4060                       0.0                        8.0        0   \n",
       "4242                       1.0                        3.0        0   \n",
       "4282                       NaN                        NaN        0   \n",
       "4286                       0.0                        0.0        0   \n",
       "4630                       NaN                        NaN        0   \n",
       "4664                       2.0                        3.0        0   \n",
       "4692                       NaN                        NaN        0   \n",
       "4826                       0.0                        4.0        0   \n",
       "4830                       1.0                        3.0        0   \n",
       "5346                       1.0                        3.0        0   \n",
       "5570                       0.0                        5.0        0   \n",
       "6056                       1.0                        4.0        0   \n",
       "6092                       2.0                        3.0        0   \n",
       "6229                       0.0                        3.0        0   \n",
       "6811                       2.0                        6.0        0   \n",
       "7159                       1.0                        1.0        0   \n",
       "7482                       2.0                        4.0        0   \n",
       "7533                       0.0                        8.0        0   \n",
       "7541                       0.0                        3.0        0   \n",
       "7578                       0.0                        1.0        0   \n",
       "7613                       0.0                        3.0        0   \n",
       "7681                       0.0                        2.0        0   \n",
       "7778                       2.0                        2.0        0   \n",
       "7921                       0.0                        0.0        0   \n",
       "7937                       2.0                        1.0        0   \n",
       "8123                       1.0                        5.0        0   \n",
       "8161                       NaN                        NaN        0   \n",
       "8217                       0.0                        0.0        0   \n",
       "\n",
       "     DAYS_BIRTH-m-DAYS_REGISTRATION  DAYS_REGISTRATION-m-DAYS_ID_PUBLISH  \\\n",
       "809                        -16339.0                               -137.0   \n",
       "1273                       -14908.0                              -1556.0   \n",
       "1485                       -14466.0                                  0.0   \n",
       "1503                       -14416.0                               3087.0   \n",
       "1579                       -14240.0                               3122.0   \n",
       "2120                       -13224.0                               2680.0   \n",
       "2250                       -13007.0                              -3584.0   \n",
       "2686                       -12394.0                              -4075.0   \n",
       "3563                       -11225.0                              -5242.0   \n",
       "3718                       -11046.0                                 34.0   \n",
       "3804                       -10917.0                              -5569.0   \n",
       "4060                       -10609.0                               1499.0   \n",
       "4242                       -10409.0                               2226.0   \n",
       "4282                       -10351.0                               2672.0   \n",
       "4286                       -10331.0                              -6948.0   \n",
       "4630                        -9940.0                               1812.0   \n",
       "4664                        -9897.0                              -1047.0   \n",
       "4692                        -9875.0                               2362.0   \n",
       "4826                        -9728.0                               1074.0   \n",
       "4830                        -9724.0                               -782.0   \n",
       "5346                        -9070.0                               -354.0   \n",
       "5570                        -8802.0                               1485.0   \n",
       "6056                        -8180.0                              -6614.0   \n",
       "6092                        -8113.0                              -6220.0   \n",
       "6229                        -7933.0                                505.0   \n",
       "6811                        -7135.0                              -2354.0   \n",
       "7159                        -6441.0                              -2821.0   \n",
       "7482                        -6104.0                              -1374.0   \n",
       "7533                        -6074.0                              -3019.0   \n",
       "7541                        -6073.0                              -1620.0   \n",
       "7578                        -6053.0                              -2036.0   \n",
       "7613                        -6038.0                              -1657.0   \n",
       "7681                        -5992.0                              -3292.0   \n",
       "7778                        -5951.0                              -2465.0   \n",
       "7921                        -5896.0                              -4414.0   \n",
       "7937                        -5890.0                              -4369.0   \n",
       "8123                        -5825.0                              -1718.0   \n",
       "8161                        -5746.0                              -3361.0   \n",
       "8217                        -5617.0                              -2974.0   \n",
       "\n",
       "      DAYS_ID_PUBLISH-m-DAYS_EMPLOYED  dup_cnt  dup_id  \n",
       "809                              2571        2     403  \n",
       "1273                               60        2     634  \n",
       "1485                             1571        2     740  \n",
       "1503                             -264        2     749  \n",
       "1579                            -3140        2     787  \n",
       "2120                            -2762        2    1056  \n",
       "2250                            -2760        2    1121  \n",
       "2686                             6245        2    1338  \n",
       "3563                            -2434        2    1775  \n",
       "3718                              446        2    1852  \n",
       "3804                             -281        2    1895  \n",
       "4060                             1476        2    2023  \n",
       "4242                             -882        2    2114  \n",
       "4282                            -3771        2    2134  \n",
       "4286                             -952        2    2136  \n",
       "4630                            -1782        2    2306  \n",
       "4664                            -2430        2    2323  \n",
       "4692                             -931        2    2337  \n",
       "4826                            -1653        2    2404  \n",
       "4830                            -2385        2    2406  \n",
       "5346                            -1119        2    2663  \n",
       "5570                            -1226        2    2775  \n",
       "6056                              967        2    3016  \n",
       "6092                              -19        2    3034  \n",
       "6229                            -2525        2    3102  \n",
       "6811                             -156        2    3392  \n",
       "7159                            -4891        2    3566  \n",
       "7482                            -2503        2    3726  \n",
       "7533                             1265        2    3751  \n",
       "7541                            -1713        2    3755  \n",
       "7578                             -172        3    3773  \n",
       "7613                            -2079        2    3790  \n",
       "7681                            -1324        2    3824  \n",
       "7778                            -2384        2    3872  \n",
       "7921                            -4894        2    3942  \n",
       "7937                            -1820        2    3950  \n",
       "8123                            -1560        2    4042  \n",
       "8161                             1176        2    4061  \n",
       "8217                               66        2    4089  \n",
       "\n",
       "[39 rows x 128 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup[dup.dup_id.isin(dup_id_test_t1)][dup.is_train==0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:04.336206Z",
     "start_time": "2018-08-25T11:27:04.321147Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n",
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:2: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
      "  \n"
     ]
    }
   ],
   "source": [
    "ids_0 = dup[dup.dup_id.isin(dup_id_test_t0)][dup.is_train==0].SK_ID_CURR.tolist()\n",
    "ids_1 = dup[dup.dup_id.isin(dup_id_test_t1)][dup.is_train==0].SK_ID_CURR.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:05.826125Z",
     "start_time": "2018-08-25T11:27:05.821048Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1, {358955})"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len( set(ids_0) & set(ids_1) ), set(ids_0) & set(ids_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:07.556270Z",
     "start_time": "2018-08-25T11:27:07.531100Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>CODE_GENDER</th>\n",
       "      <th>FLAG_OWN_CAR</th>\n",
       "      <th>FLAG_OWN_REALTY</th>\n",
       "      <th>CNT_CHILDREN</th>\n",
       "      <th>AMT_INCOME_TOTAL</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>...</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_WEEK</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_MON</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_QRT</th>\n",
       "      <th>AMT_REQ_CREDIT_BUREAU_YEAR</th>\n",
       "      <th>is_train</th>\n",
       "      <th>DAYS_BIRTH-m-DAYS_REGISTRATION</th>\n",
       "      <th>DAYS_REGISTRATION-m-DAYS_ID_PUBLISH</th>\n",
       "      <th>DAYS_ID_PUBLISH-m-DAYS_EMPLOYED</th>\n",
       "      <th>dup_cnt</th>\n",
       "      <th>dup_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7576</th>\n",
       "      <td>107055</td>\n",
       "      <td>1.0</td>\n",
       "      <td>Revolving loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>22500.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>-6053.0</td>\n",
       "      <td>-2036.0</td>\n",
       "      <td>-172</td>\n",
       "      <td>3</td>\n",
       "      <td>3773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7577</th>\n",
       "      <td>359620</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>270000.0</td>\n",
       "      <td>254700.0</td>\n",
       "      <td>27022.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>-6053.0</td>\n",
       "      <td>-2036.0</td>\n",
       "      <td>-172</td>\n",
       "      <td>3</td>\n",
       "      <td>3773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7578</th>\n",
       "      <td>358955</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>M</td>\n",
       "      <td>Y</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>225000.0</td>\n",
       "      <td>269982.0</td>\n",
       "      <td>28480.5</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>-6053.0</td>\n",
       "      <td>-2036.0</td>\n",
       "      <td>-172</td>\n",
       "      <td>3</td>\n",
       "      <td>3773</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 128 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      SK_ID_CURR  TARGET NAME_CONTRACT_TYPE CODE_GENDER FLAG_OWN_CAR  \\\n",
       "7576      107055     1.0    Revolving loans           M            Y   \n",
       "7577      359620     0.0         Cash loans           M            Y   \n",
       "7578      358955     NaN         Cash loans           M            Y   \n",
       "\n",
       "     FLAG_OWN_REALTY  CNT_CHILDREN  AMT_INCOME_TOTAL  AMT_CREDIT  AMT_ANNUITY  \\\n",
       "7576               N             1          225000.0    450000.0      22500.0   \n",
       "7577               N             1          270000.0    254700.0      27022.5   \n",
       "7578               N             1          225000.0    269982.0      28480.5   \n",
       "\n",
       "       ...    AMT_REQ_CREDIT_BUREAU_WEEK AMT_REQ_CREDIT_BUREAU_MON  \\\n",
       "7576   ...                           0.0                       0.0   \n",
       "7577   ...                           0.0                       0.0   \n",
       "7578   ...                           0.0                       0.0   \n",
       "\n",
       "     AMT_REQ_CREDIT_BUREAU_QRT AMT_REQ_CREDIT_BUREAU_YEAR is_train  \\\n",
       "7576                       0.0                        1.0        1   \n",
       "7577                       0.0                        1.0        1   \n",
       "7578                       0.0                        1.0        0   \n",
       "\n",
       "     DAYS_BIRTH-m-DAYS_REGISTRATION  DAYS_REGISTRATION-m-DAYS_ID_PUBLISH  \\\n",
       "7576                        -6053.0                              -2036.0   \n",
       "7577                        -6053.0                              -2036.0   \n",
       "7578                        -6053.0                              -2036.0   \n",
       "\n",
       "      DAYS_ID_PUBLISH-m-DAYS_EMPLOYED  dup_cnt  dup_id  \n",
       "7576                             -172        3    3773  \n",
       "7577                             -172        3    3773  \n",
       "7578                             -172        3    3773  \n",
       "\n",
       "[3 rows x 128 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup[dup.dup_id==3773]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:10.774597Z",
     "start_time": "2018-08-25T11:27:10.771164Z"
    }
   },
   "outputs": [],
   "source": [
    "# remove 358955\n",
    "ids_0.remove(358955)\n",
    "ids_1.remove(358955)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Swap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:15.015728Z",
     "start_time": "2018-08-25T11:27:14.996160Z"
    }
   },
   "outputs": [],
   "source": [
    "sub.sort_values('TARGET', inplace=True)\n",
    "\n",
    "sub_0 = sub[sub.SK_ID_CURR.isin(ids_0)].reset_index(drop=True)\n",
    "sub_1 = sub[sub.SK_ID_CURR.isin(ids_1)].reset_index(drop=True)\n",
    "sub_other = sub[~sub.SK_ID_CURR.isin(ids_0+ids_1)].reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:15.715903Z",
     "start_time": "2018-08-25T11:27:15.701045Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>126822</td>\n",
       "      <td>0.000574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>177424</td>\n",
       "      <td>0.001026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>197224</td>\n",
       "      <td>0.001087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>251267</td>\n",
       "      <td>0.001313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>331032</td>\n",
       "      <td>0.001559</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>234695</td>\n",
       "      <td>0.001580</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>443039</td>\n",
       "      <td>0.002852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>416826</td>\n",
       "      <td>0.003262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>335313</td>\n",
       "      <td>0.003980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>124362</td>\n",
       "      <td>0.004021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>415117</td>\n",
       "      <td>0.005252</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>325377</td>\n",
       "      <td>0.006278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>268761</td>\n",
       "      <td>0.006626</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>215488</td>\n",
       "      <td>0.007037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>369717</td>\n",
       "      <td>0.008206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>219000</td>\n",
       "      <td>0.008596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>241395</td>\n",
       "      <td>0.008822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>211150</td>\n",
       "      <td>0.009211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>169836</td>\n",
       "      <td>0.009252</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>307177</td>\n",
       "      <td>0.010627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>212533</td>\n",
       "      <td>0.011591</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>171997</td>\n",
       "      <td>0.011612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>270894</td>\n",
       "      <td>0.012125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>421690</td>\n",
       "      <td>0.012740</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>130264</td>\n",
       "      <td>0.012925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>207060</td>\n",
       "      <td>0.014032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>331370</td>\n",
       "      <td>0.014956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>297269</td>\n",
       "      <td>0.015038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>310568</td>\n",
       "      <td>0.015099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>431373</td>\n",
       "      <td>0.018402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1531</th>\n",
       "      <td>419171</td>\n",
       "      <td>0.975853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1532</th>\n",
       "      <td>191490</td>\n",
       "      <td>0.976079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1533</th>\n",
       "      <td>290379</td>\n",
       "      <td>0.976756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1534</th>\n",
       "      <td>146060</td>\n",
       "      <td>0.977310</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1535</th>\n",
       "      <td>164526</td>\n",
       "      <td>0.978049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1536</th>\n",
       "      <td>203821</td>\n",
       "      <td>0.978254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1537</th>\n",
       "      <td>138481</td>\n",
       "      <td>0.978336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1538</th>\n",
       "      <td>342802</td>\n",
       "      <td>0.978377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1539</th>\n",
       "      <td>229810</td>\n",
       "      <td>0.978685</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1540</th>\n",
       "      <td>118871</td>\n",
       "      <td>0.979321</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1541</th>\n",
       "      <td>280524</td>\n",
       "      <td>0.980326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1542</th>\n",
       "      <td>269293</td>\n",
       "      <td>0.980982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1543</th>\n",
       "      <td>202484</td>\n",
       "      <td>0.982193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1544</th>\n",
       "      <td>311170</td>\n",
       "      <td>0.984490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1545</th>\n",
       "      <td>344229</td>\n",
       "      <td>0.985516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1546</th>\n",
       "      <td>181538</td>\n",
       "      <td>0.985783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1547</th>\n",
       "      <td>259020</td>\n",
       "      <td>0.985824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1548</th>\n",
       "      <td>311609</td>\n",
       "      <td>0.986255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1549</th>\n",
       "      <td>272148</td>\n",
       "      <td>0.987055</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1550</th>\n",
       "      <td>126438</td>\n",
       "      <td>0.987875</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1551</th>\n",
       "      <td>321416</td>\n",
       "      <td>0.989188</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1552</th>\n",
       "      <td>116880</td>\n",
       "      <td>0.989435</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1553</th>\n",
       "      <td>169580</td>\n",
       "      <td>0.989619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1554</th>\n",
       "      <td>423061</td>\n",
       "      <td>0.992348</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1555</th>\n",
       "      <td>372463</td>\n",
       "      <td>0.992573</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1556</th>\n",
       "      <td>318615</td>\n",
       "      <td>0.992738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1557</th>\n",
       "      <td>296696</td>\n",
       "      <td>0.993045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1558</th>\n",
       "      <td>381754</td>\n",
       "      <td>0.993374</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1559</th>\n",
       "      <td>141215</td>\n",
       "      <td>0.998215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1560</th>\n",
       "      <td>378349</td>\n",
       "      <td>0.999241</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1561 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      SK_ID_CURR    TARGET\n",
       "0         126822  0.000574\n",
       "1         177424  0.001026\n",
       "2         197224  0.001087\n",
       "3         251267  0.001313\n",
       "4         331032  0.001559\n",
       "5         234695  0.001580\n",
       "6         443039  0.002852\n",
       "7         416826  0.003262\n",
       "8         335313  0.003980\n",
       "9         124362  0.004021\n",
       "10        415117  0.005252\n",
       "11        325377  0.006278\n",
       "12        268761  0.006626\n",
       "13        215488  0.007037\n",
       "14        369717  0.008206\n",
       "15        219000  0.008596\n",
       "16        241395  0.008822\n",
       "17        211150  0.009211\n",
       "18        169836  0.009252\n",
       "19        307177  0.010627\n",
       "20        212533  0.011591\n",
       "21        171997  0.011612\n",
       "22        270894  0.012125\n",
       "23        421690  0.012740\n",
       "24        130264  0.012925\n",
       "25        207060  0.014032\n",
       "26        331370  0.014956\n",
       "27        297269  0.015038\n",
       "28        310568  0.015099\n",
       "29        431373  0.018402\n",
       "...          ...       ...\n",
       "1531      419171  0.975853\n",
       "1532      191490  0.976079\n",
       "1533      290379  0.976756\n",
       "1534      146060  0.977310\n",
       "1535      164526  0.978049\n",
       "1536      203821  0.978254\n",
       "1537      138481  0.978336\n",
       "1538      342802  0.978377\n",
       "1539      229810  0.978685\n",
       "1540      118871  0.979321\n",
       "1541      280524  0.980326\n",
       "1542      269293  0.980982\n",
       "1543      202484  0.982193\n",
       "1544      311170  0.984490\n",
       "1545      344229  0.985516\n",
       "1546      181538  0.985783\n",
       "1547      259020  0.985824\n",
       "1548      311609  0.986255\n",
       "1549      272148  0.987055\n",
       "1550      126438  0.987875\n",
       "1551      321416  0.989188\n",
       "1552      116880  0.989435\n",
       "1553      169580  0.989619\n",
       "1554      423061  0.992348\n",
       "1555      372463  0.992573\n",
       "1556      318615  0.992738\n",
       "1557      296696  0.993045\n",
       "1558      381754  0.993374\n",
       "1559      141215  0.998215\n",
       "1560      378349  0.999241\n",
       "\n",
       "[1561 rows x 2 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:16.112290Z",
     "start_time": "2018-08-25T11:27:16.101135Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>268602</td>\n",
       "      <td>0.484490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>288876</td>\n",
       "      <td>0.528270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>401332</td>\n",
       "      <td>0.531573</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>310586</td>\n",
       "      <td>0.581323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>145157</td>\n",
       "      <td>0.615686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>311157</td>\n",
       "      <td>0.651034</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>362872</td>\n",
       "      <td>0.715678</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>175737</td>\n",
       "      <td>0.757570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>370844</td>\n",
       "      <td>0.763417</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>103171</td>\n",
       "      <td>0.764032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>421998</td>\n",
       "      <td>0.770905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>427067</td>\n",
       "      <td>0.788856</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>279778</td>\n",
       "      <td>0.793062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>224488</td>\n",
       "      <td>0.794067</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>209288</td>\n",
       "      <td>0.839734</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>407091</td>\n",
       "      <td>0.851223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>445047</td>\n",
       "      <td>0.882303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>213957</td>\n",
       "      <td>0.901116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>137651</td>\n",
       "      <td>0.902142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>222303</td>\n",
       "      <td>0.906430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>152833</td>\n",
       "      <td>0.918903</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281876</td>\n",
       "      <td>0.925899</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>338581</td>\n",
       "      <td>0.954312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>282317</td>\n",
       "      <td>0.958026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>401230</td>\n",
       "      <td>0.966539</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>423503</td>\n",
       "      <td>0.967196</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>419787</td>\n",
       "      <td>0.974048</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>119813</td>\n",
       "      <td>0.974602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>134494</td>\n",
       "      <td>0.975997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>108045</td>\n",
       "      <td>0.983916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>140996</td>\n",
       "      <td>0.987486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>317227</td>\n",
       "      <td>0.988840</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>381121</td>\n",
       "      <td>0.992450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>273336</td>\n",
       "      <td>0.993333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>381203</td>\n",
       "      <td>0.994133</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>293996</td>\n",
       "      <td>0.997928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>316815</td>\n",
       "      <td>0.998646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>288138</td>\n",
       "      <td>0.999979</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    SK_ID_CURR    TARGET\n",
       "0       268602  0.484490\n",
       "1       288876  0.528270\n",
       "2       401332  0.531573\n",
       "3       310586  0.581323\n",
       "4       145157  0.615686\n",
       "5       311157  0.651034\n",
       "6       362872  0.715678\n",
       "7       175737  0.757570\n",
       "8       370844  0.763417\n",
       "9       103171  0.764032\n",
       "10      421998  0.770905\n",
       "11      427067  0.788856\n",
       "12      279778  0.793062\n",
       "13      224488  0.794067\n",
       "14      209288  0.839734\n",
       "15      407091  0.851223\n",
       "16      445047  0.882303\n",
       "17      213957  0.901116\n",
       "18      137651  0.902142\n",
       "19      222303  0.906430\n",
       "20      152833  0.918903\n",
       "21      281876  0.925899\n",
       "22      338581  0.954312\n",
       "23      282317  0.958026\n",
       "24      401230  0.966539\n",
       "25      423503  0.967196\n",
       "26      419787  0.974048\n",
       "27      119813  0.974602\n",
       "28      134494  0.975997\n",
       "29      108045  0.983916\n",
       "30      140996  0.987486\n",
       "31      317227  0.988840\n",
       "32      381121  0.992450\n",
       "33      273336  0.993333\n",
       "34      381203  0.994133\n",
       "35      293996  0.997928\n",
       "36      316815  0.998646\n",
       "37      288138  0.999979"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:17.016532Z",
     "start_time": "2018-08-25T11:27:17.011270Z"
    }
   },
   "outputs": [],
   "source": [
    "target_all = sorted(sub_0.append(sub_1).TARGET.values)\n",
    "target_0, target_1 = target_all[:sub_0.shape[0]], target_all[sub_0.shape[0]:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:18.024859Z",
     "start_time": "2018-08-25T11:27:18.020869Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1561, 38)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(target_0), len(target_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:18.774760Z",
     "start_time": "2018-08-25T11:27:18.770902Z"
    }
   },
   "outputs": [],
   "source": [
    "sub_0.TARGET = target_0\n",
    "sub_1.TARGET = target_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:19.984815Z",
     "start_time": "2018-08-25T11:27:19.970896Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>126822</td>\n",
       "      <td>0.000574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>177424</td>\n",
       "      <td>0.001026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>197224</td>\n",
       "      <td>0.001087</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>251267</td>\n",
       "      <td>0.001313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>331032</td>\n",
       "      <td>0.001559</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>234695</td>\n",
       "      <td>0.001580</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>443039</td>\n",
       "      <td>0.002852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>416826</td>\n",
       "      <td>0.003262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>335313</td>\n",
       "      <td>0.003980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>124362</td>\n",
       "      <td>0.004021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>415117</td>\n",
       "      <td>0.005252</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>325377</td>\n",
       "      <td>0.006278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>268761</td>\n",
       "      <td>0.006626</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>215488</td>\n",
       "      <td>0.007037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>369717</td>\n",
       "      <td>0.008206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>219000</td>\n",
       "      <td>0.008596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>241395</td>\n",
       "      <td>0.008822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>211150</td>\n",
       "      <td>0.009211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>169836</td>\n",
       "      <td>0.009252</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>307177</td>\n",
       "      <td>0.010627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>212533</td>\n",
       "      <td>0.011591</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>171997</td>\n",
       "      <td>0.011612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>270894</td>\n",
       "      <td>0.012125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>421690</td>\n",
       "      <td>0.012740</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>130264</td>\n",
       "      <td>0.012925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>207060</td>\n",
       "      <td>0.014032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>331370</td>\n",
       "      <td>0.014956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>297269</td>\n",
       "      <td>0.015038</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>310568</td>\n",
       "      <td>0.015099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>431373</td>\n",
       "      <td>0.018402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1531</th>\n",
       "      <td>419171</td>\n",
       "      <td>0.960508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1532</th>\n",
       "      <td>191490</td>\n",
       "      <td>0.961164</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1533</th>\n",
       "      <td>290379</td>\n",
       "      <td>0.961595</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1534</th>\n",
       "      <td>146060</td>\n",
       "      <td>0.961903</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1535</th>\n",
       "      <td>164526</td>\n",
       "      <td>0.962006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1536</th>\n",
       "      <td>203821</td>\n",
       "      <td>0.962231</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1537</th>\n",
       "      <td>138481</td>\n",
       "      <td>0.965473</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1538</th>\n",
       "      <td>342802</td>\n",
       "      <td>0.965760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1539</th>\n",
       "      <td>229810</td>\n",
       "      <td>0.966006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1540</th>\n",
       "      <td>118871</td>\n",
       "      <td>0.966437</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1541</th>\n",
       "      <td>280524</td>\n",
       "      <td>0.966478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1542</th>\n",
       "      <td>269293</td>\n",
       "      <td>0.966498</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1543</th>\n",
       "      <td>202484</td>\n",
       "      <td>0.966539</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1544</th>\n",
       "      <td>311170</td>\n",
       "      <td>0.966929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1545</th>\n",
       "      <td>344229</td>\n",
       "      <td>0.967196</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1546</th>\n",
       "      <td>181538</td>\n",
       "      <td>0.968345</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1547</th>\n",
       "      <td>259020</td>\n",
       "      <td>0.968447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1548</th>\n",
       "      <td>311609</td>\n",
       "      <td>0.968550</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1549</th>\n",
       "      <td>272148</td>\n",
       "      <td>0.969330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1550</th>\n",
       "      <td>126438</td>\n",
       "      <td>0.969494</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1551</th>\n",
       "      <td>321416</td>\n",
       "      <td>0.971361</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1552</th>\n",
       "      <td>116880</td>\n",
       "      <td>0.972058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1553</th>\n",
       "      <td>169580</td>\n",
       "      <td>0.973248</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1554</th>\n",
       "      <td>423061</td>\n",
       "      <td>0.974048</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1555</th>\n",
       "      <td>372463</td>\n",
       "      <td>0.974561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1556</th>\n",
       "      <td>318615</td>\n",
       "      <td>0.974602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1557</th>\n",
       "      <td>296696</td>\n",
       "      <td>0.974848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1558</th>\n",
       "      <td>381754</td>\n",
       "      <td>0.975628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1559</th>\n",
       "      <td>141215</td>\n",
       "      <td>0.975853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1560</th>\n",
       "      <td>378349</td>\n",
       "      <td>0.975997</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1561 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      SK_ID_CURR    TARGET\n",
       "0         126822  0.000574\n",
       "1         177424  0.001026\n",
       "2         197224  0.001087\n",
       "3         251267  0.001313\n",
       "4         331032  0.001559\n",
       "5         234695  0.001580\n",
       "6         443039  0.002852\n",
       "7         416826  0.003262\n",
       "8         335313  0.003980\n",
       "9         124362  0.004021\n",
       "10        415117  0.005252\n",
       "11        325377  0.006278\n",
       "12        268761  0.006626\n",
       "13        215488  0.007037\n",
       "14        369717  0.008206\n",
       "15        219000  0.008596\n",
       "16        241395  0.008822\n",
       "17        211150  0.009211\n",
       "18        169836  0.009252\n",
       "19        307177  0.010627\n",
       "20        212533  0.011591\n",
       "21        171997  0.011612\n",
       "22        270894  0.012125\n",
       "23        421690  0.012740\n",
       "24        130264  0.012925\n",
       "25        207060  0.014032\n",
       "26        331370  0.014956\n",
       "27        297269  0.015038\n",
       "28        310568  0.015099\n",
       "29        431373  0.018402\n",
       "...          ...       ...\n",
       "1531      419171  0.960508\n",
       "1532      191490  0.961164\n",
       "1533      290379  0.961595\n",
       "1534      146060  0.961903\n",
       "1535      164526  0.962006\n",
       "1536      203821  0.962231\n",
       "1537      138481  0.965473\n",
       "1538      342802  0.965760\n",
       "1539      229810  0.966006\n",
       "1540      118871  0.966437\n",
       "1541      280524  0.966478\n",
       "1542      269293  0.966498\n",
       "1543      202484  0.966539\n",
       "1544      311170  0.966929\n",
       "1545      344229  0.967196\n",
       "1546      181538  0.968345\n",
       "1547      259020  0.968447\n",
       "1548      311609  0.968550\n",
       "1549      272148  0.969330\n",
       "1550      126438  0.969494\n",
       "1551      321416  0.971361\n",
       "1552      116880  0.972058\n",
       "1553      169580  0.973248\n",
       "1554      423061  0.974048\n",
       "1555      372463  0.974561\n",
       "1556      318615  0.974602\n",
       "1557      296696  0.974848\n",
       "1558      381754  0.975628\n",
       "1559      141215  0.975853\n",
       "1560      378349  0.975997\n",
       "\n",
       "[1561 rows x 2 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:20.941425Z",
     "start_time": "2018-08-25T11:27:20.930941Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>TARGET</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>268602</td>\n",
       "      <td>0.976079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>288876</td>\n",
       "      <td>0.976756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>401332</td>\n",
       "      <td>0.977310</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>310586</td>\n",
       "      <td>0.978049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>145157</td>\n",
       "      <td>0.978254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>311157</td>\n",
       "      <td>0.978336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>362872</td>\n",
       "      <td>0.978377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>175737</td>\n",
       "      <td>0.978685</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>370844</td>\n",
       "      <td>0.979321</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>103171</td>\n",
       "      <td>0.980326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>421998</td>\n",
       "      <td>0.980982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>427067</td>\n",
       "      <td>0.982193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>279778</td>\n",
       "      <td>0.983916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>224488</td>\n",
       "      <td>0.984490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>209288</td>\n",
       "      <td>0.985516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>407091</td>\n",
       "      <td>0.985783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>445047</td>\n",
       "      <td>0.985824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>213957</td>\n",
       "      <td>0.986255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>137651</td>\n",
       "      <td>0.987055</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>222303</td>\n",
       "      <td>0.987486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>152833</td>\n",
       "      <td>0.987875</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281876</td>\n",
       "      <td>0.988840</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>338581</td>\n",
       "      <td>0.989188</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>282317</td>\n",
       "      <td>0.989435</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>401230</td>\n",
       "      <td>0.989619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>423503</td>\n",
       "      <td>0.992348</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>419787</td>\n",
       "      <td>0.992450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>119813</td>\n",
       "      <td>0.992573</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>134494</td>\n",
       "      <td>0.992738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>108045</td>\n",
       "      <td>0.993045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>140996</td>\n",
       "      <td>0.993333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>317227</td>\n",
       "      <td>0.993374</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>381121</td>\n",
       "      <td>0.994133</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>273336</td>\n",
       "      <td>0.997928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>381203</td>\n",
       "      <td>0.998215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>293996</td>\n",
       "      <td>0.998646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>316815</td>\n",
       "      <td>0.999241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>288138</td>\n",
       "      <td>0.999979</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    SK_ID_CURR    TARGET\n",
       "0       268602  0.976079\n",
       "1       288876  0.976756\n",
       "2       401332  0.977310\n",
       "3       310586  0.978049\n",
       "4       145157  0.978254\n",
       "5       311157  0.978336\n",
       "6       362872  0.978377\n",
       "7       175737  0.978685\n",
       "8       370844  0.979321\n",
       "9       103171  0.980326\n",
       "10      421998  0.980982\n",
       "11      427067  0.982193\n",
       "12      279778  0.983916\n",
       "13      224488  0.984490\n",
       "14      209288  0.985516\n",
       "15      407091  0.985783\n",
       "16      445047  0.985824\n",
       "17      213957  0.986255\n",
       "18      137651  0.987055\n",
       "19      222303  0.987486\n",
       "20      152833  0.987875\n",
       "21      281876  0.988840\n",
       "22      338581  0.989188\n",
       "23      282317  0.989435\n",
       "24      401230  0.989619\n",
       "25      423503  0.992348\n",
       "26      419787  0.992450\n",
       "27      119813  0.992573\n",
       "28      134494  0.992738\n",
       "29      108045  0.993045\n",
       "30      140996  0.993333\n",
       "31      317227  0.993374\n",
       "32      381121  0.994133\n",
       "33      273336  0.997928\n",
       "34      381203  0.998215\n",
       "35      293996  0.998646\n",
       "36      316815  0.999241\n",
       "37      288138  0.999979"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:21.732348Z",
     "start_time": "2018-08-25T11:27:21.720963Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(48744, 2)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_new = pd.concat([sub_0, sub_1, sub_other])\n",
    "sub_new.sort_values('TARGET', inplace=True)\n",
    "sub_new.reset_index(drop=True, inplace=True)\n",
    "\n",
    "sub_new.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:22.474532Z",
     "start_time": "2018-08-25T11:27:22.470972Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(48744, 2)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:23.707551Z",
     "start_time": "2018-08-25T11:27:23.701077Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(48744,)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sub_new.SK_ID_CURR.unique().shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-25T11:27:24.720557Z",
     "start_time": "2018-08-25T11:27:24.320874Z"
    }
   },
   "outputs": [],
   "source": [
    "sub_new.to_csv('../output/stochastic_blending_v3-2_0.308rk7_0.431mw1_0.261t1_0.81050CV_0.3Adv_Leak004.csv.gz', index=False, compression='gzip')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
